package gms.distriblaw;

/**
 * Created by IntelliJ IDEA.
 * User: Anton Dunaev
 * Date: 04.10.2007
 * Time: 13:36:41
 */
public class UniformDistribLaw extends DistribLaw
{
    protected double a;
    protected double b;

    public UniformDistribLaw( double a, double b )
    {
        if( a > b )
        {
            double t = a;
            a = b;
            b = t;
        }
        this.a = a;
        this.b = b;
    }

    public double getRand()
    {
        return  a + rnd.nextDouble()*(b - a);
    }
}
